<!DOCTYPE html>
<html>
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>后台板块管理</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="favicon.ico">
    <link href="__ADMIN__css/bootstrap.min14ed.css" rel="stylesheet">
    <link href="__ADMIN__css/font-awesome.min93e3.css" rel="stylesheet">
    <link href="__ADMIN__css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__ADMIN__css/animate.min.css" rel="stylesheet">
    <link href="__ADMIN__css/style.min862f.css" rel="stylesheet">
    <link href="__ADMIN__js/plugins/layer/skin/layer.css" rel="stylesheet">
    <link href="__ADMIN__js/plugins/layer/laypage/skin/laypage.css" rel="stylesheet">

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>板块管理</h5>
                    <div class="ibox-tools">
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="row m-b-sm m-t-sm">
                        <form name="form1" id="form1" method="get" action="{:U('position/index')}">
                        <div class="col-md-2">
                            <a href="{:U('position/add')}" class="btn btn-outline btn-primary">添加板块</a>
                        </div>
                        </form>
                    </div>

                    <table class="table table-bordered">
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>板位名称</th>
                            <th>板位类型</th>
                            <th>版位尺寸</th>
                            <th>广告数</th>
                            <th>版位描述</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody id="show">
                            <volist name="list" id="vo">
                                <tr>
                                    <td>{$vo.id}</td>
                                    <td>{$vo.title}</td>
                                    <td>{$vo.type}</td>
                                    <td>{$vo.width}*{$vo.height}</td>
                                    <td>{$vo.num}</td>
                                    <td>{$vo.description}</td>
                                    <td>
                                        <if condition="($vo.status eq 1)">
                                            <a href="javascript:changeState({$vo.id})" id="state{$vo.id}" class="btn btn-primary dim">正常</a>

                                            <else />
                                            <a href="javascript:changeState({$vo.id})" id="state{$vo.id}" class="btn btn-danger dim">禁用</a>
                                        </if>
                                    </td>
                                    <td>
                                        <a href="{:U('Admin/ad/add?pid='.$vo['id'])}" class="btn btn-outline btn-primary"><i class="fa fa-plus-square-o"></i>&nbsp;添加广告</a>&nbsp;&nbsp;
                                        <a href="{:U('Admin/position/edit?id='.$vo['id'])}" class="btn btn-outline btn-primary"><i class="fa fa-edit"></i>&nbsp;修改</a>&nbsp;&nbsp;
                                        <a href="javascript:delData({$vo.id})" class="btn btn-outline btn-danger"><i class="fa fa-trash"></i>&nbsp;删除</a></td>
                                </tr>
                            </volist>
                        </tbody>
                    </table>
                   <!--  <div id="pages" style="text-align: center"></div> -->
                </div>
            </div>
        </div>
    </div>
</div>
<script src="__ADMIN__js/jquery.min.js"></script>
<script src="__ADMIN__js/bootstrap.min.js"></script>
<script src="__ADMIN__js/plugins/layer/layer.min.js"></script>
<script src="__ADMIN__js/common.js"></script>
<script src="__ADMIN__js/plugins/layer/laypage/laypage.js"></script>
<script>
function delData(id){
    common.del("{:U("position/del")}",id,"{:U("position/index")}");
}
function changeState(id){
    var idstr = '#state'+id;
    var objectState = $(idstr);
    common.status("{:U('position/changeState')}",id,objectState);
}

</script>
</html>
